SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Loic Jacolin>
-- Create date: <18/12/2012>
-- Description:	<Fiche livre>
-- =============================================
CREATE PROCEDURE ps_detaillivre @id INT
AS
BEGIN
	SET NOCOUNT ON;

    SELECT LIV_ID, LIV_ISBN, LIV_TITRE, LIV_SOUSTITRE, LIV_PRIXHT, LIV_RESUME, LIV_DATEPUBLICATION, LIV_NBPAGES, LIV_STOCK, TVA_TAUX, EDI_NOM, GEN_LABEL, EVE_LABEL
FROM T_LIVRES L INNER JOIN T_TVA T
ON L.TVA_ID = T.TVA_ID
INNER JOIN T_EDITEURS E
ON L.EDI_ID = E.EDI_ID
INNER JOIN T_GENRES G
ON L.GEN_ID = G.GEN_ID
LEFT OUTER JOIN T_EVENTS EV
ON L.EVE_ID = EV.EVE_ID
WHERE L.LIV_ID = @id

END
GO
